home *** CD-ROM | disk | FTP | other *** search
- Program ObjGen;
-
- Uses Crt;
-
- Type ObjType=Record
- Name:String[80];
- Pos:Byte;
- Desc:Array[1..5] Of String[80];
- End;
-
- Var F:Text;
- Filename:String;
- NumberObjs:Byte;
-
- A:Byte;
- B:Byte;
- R:ObjType;
- Flag:Boolean;
-
- Begin
- Clrscr;
- Textcolor(Yellow);
- Write('«««««««««««««««««««««««««««««« Object Generator »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»');
- Writeln;
- Textcolor(Magenta);
- Writeln(' By Spellcaster');
- Writeln;
- Textcolor(Cyan);
- Writeln('Type in the name of the file on which the data of the objects');
- Writeln('will be write...');
- Textcolor(Green);
- Write('Name of the object-file > ');
- Readln(Filename);
- If Filename='' Then Exit;
- Textcolor(Cyan);
- Writeln('Type in the number of objects that the game has...');
- Textcolor(LightRed);
- Write('Number of objects > ');
- Readln(NumberObjs);
- If NumberObjs=0 Then Exit;
- Assign(F,Filename);
- ReWrite(F);
- For A:=1 To NumberObjs Do
- Begin
- Writeln;
- Textcolor(Cyan);
- Writeln('Object ',A);
- Writeln;
- Textcolor(LightGreen);
- Write('Name of object > '); Readln(R.Name);
- Writeln;
- Write('Initial position of object > '); Readln(R.Pos);
- For B:=1 To 5 Do R.Desc[B]:='';
- Flag:=True;
- B:=1;
- While Flag Do
- Begin
- Writeln('Description Line ',B);
- Readln(R.Desc[B]);
- If (B=5) Or (R.Desc[B]='*') Then Flag:=False;
- Inc(B);
- End;
- Writeln(F,R.Name);
- WritelN(F,R.Pos);
- B:=1;
- Flag:=True;
- While Flag Do
- Begin
- Writeln(F,R.Desc[B]);
- If (R.Desc[B]='*') Or (B=10) Then Flag:=False;
- Inc(B);
- End;
- End;
- Writeln;
- Close(F);
- Textcolor(Lightred);
- Writeln('The room data is saved...');
- Textcolor(LightGray);
- Repeat Until Keypressed;
- End.